<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
<title><?php __('Authentic Avenue'); ?>
		<?php echo $title_for_layout; ?></title>
<!-- Icons -->
<link rel="shortcut icon" href="<?php echo $this->webroot; ?>img/favicon.ico" type="image/x-icon" />
<!--Meta tag -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="" />
<meta name="Description" content="Buy  cars, clothing, apparel, collectibles, sporting goods, digital cameras, and everything else on Authentic Avenue, the world's online..." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<?php echo $this->Html->css(array('stylesheet_details'));?>
<script type="text/javascript">
var baseurl = "<?php echo Configure::read('base_url');?>";
</script>
<?php echo $html->script(array("jquery.min.js","script.js","jquery.jcarousel.min.js","jquery-ui.js","jquery.validate.js"));?>
<?php  echo $html->script(array("jquery.form.js","datepicker.js")); ?>
<script type="text/javascript">
jQuery(document).ready(function() {
	<?php if(isset($products['User']['id']) && ($products['User']['id'] != $session->read('Auth.User.id'))): ?>
	//menuPosition=jQuery('#fl_menu').position().top;
	//alert(menuPosition);
	//FloatMenu();
	<?php endif;?>
	//Add to cart
	jQuery("#add_to_cart").live("click",function(){
		jQuery("#loader_cart").fadeIn("200").show();
		jQuery("#fl_menu").hide();
		var pid=jQuery(this).attr("pid");
		var qty=jQuery("#product_qty").val();
		jQuery.ajax({
			type: 'GET',
			url: baseurl+"carts/addtocart/"+pid+"/"+qty,					
			dataType: 'json',
			success: function(data){				
				jQuery("#loader_cart").fadeOut("200").hide();
				jQuery("#fl_menu").show();
				alert(data.msg);
			}
		});
	});
	
	//Add to wishlists
	jQuery("#add_to_wishlists").click(function(){
		jQuery("#loader_cart").fadeIn("200").show();
		jQuery("#fl_menu").hide();
		var pid=jQuery(this).attr("pid");
		//var qty=jQuery("#product_qty").val();
		jQuery.ajax({
			type: 'GET',
			url: baseurl+"carts/addtowishlists/"+pid,					
			dataType: 'json',
			success: function(data){
				jQuery("#loader_cart").fadeOut("200").hide();
				jQuery("#fl_menu").show();
				alert(data.msg);
			}
		});	
	});
	
    jQuery('.image-thumb ul li a').click(function(){
		var track=jQuery('.image-thumb ul li a').index(this);
		jQuery('.image-content img').fadeOut("200").hide();
		jQuery(".image-content img:eq("+track+")").fadeIn("200").show();
		return false;
    });
    jQuery('[name="add_to_favorite_seller"]').click(function(){
		jQuery("#loader_cart").fadeIn("200").show();
		jQuery("#fl_menu").hide();
        jQuery.ajax({
            type : "post",
            url : baseurl+"users/add_to_favorite_seller",
            data : {"data[FavoriteSeller][buyer_id]" : '<?php echo $session->read('Auth.User.id'); ?>', "data[FavoriteSeller][seller_id]" :'<?php echo $products['User']['id'];?>'},
            success: function(data){
				jQuery("#loader_cart").fadeOut("200").hide();
				jQuery("#fl_menu").show();
                alert(data);
            }
        });
    });
	//tooltip();
	//jQuery(".draggable").draggable();
	loadAdditionalFields(<?php echo $products['Product']['category_id']?>,<?php echo $products['Product']['id']?>);
	loadAdditionalFields_label(<?php echo $products['Product']['category_id']?>,<?php echo $products['Product']['id']?>);
});

	
function loadAdditionalFields(Id,Id2){
	//Load additional fields for this category
	jQuery(".AdditionalFields").show().fadeIn("slow");
	jQuery(".AdditionalFields").html("<img alt='loading...' src='"+baseurl+"/img/loading.gif'>loading Additional information...");
	var brandurl=baseurl+"products/fetchadditionalfields_details/"+Id+"/"+Id2;
	jQuery.get(brandurl, function(data) {
	jQuery('.AdditionalFields').html(data);  
	});
}
function loadAdditionalFields_label(Id,Id2){
	//Load additional fields for this category
	jQuery(".AdditionalFields_label").show().fadeIn("slow");
	jQuery(".AdditionalFields_label").html("<img alt='loading...' src='"+baseurl+"/img/loading.gif'>loading Additional information...");
	var brandurl=baseurl+"products/fetchadditionalfields_details_label/"+Id+"/"+Id2;
	jQuery.get(brandurl, function(data) {
	jQuery('.AdditionalFields_label').html(data);  
	});
}

function FloatMenu(){
	var animationSpeed=1;
	var animationEasing='easeOutQuint';
	var scrollAmount=jQuery(document).scrollTop();
	if(scrollAmount<=240)
	var newPosition=240;
	else
	var newPosition=menuPosition+scrollAmount;
	//alert(newPosition);
	if(jQuery(window).height()<jQuery('#fl_menu').height()){
		jQuery('#fl_menu').css('top',menuPosition);
	}else {
		jQuery('#fl_menu').stop().animate({top: newPosition}, animationSpeed, animationEasing);
	}
}
//jQuery(window).scroll(function () {
//	menuPosition=0;
//	FloatMenu();
//});
</script>
<!--[if lt IE 7]>
<script type="text/javascript" src="js/DD_belatedPNG.js"></script>
<script>
  DD_belatedPNG.fix('img,div');
</script>
<![endif]-->
	<noscript>
    <div class="popupWrapper" style="display:block;margin:0 auto;">
	<div class="popupTop">&nbsp;</div>
          <div class="popupContent">              
    	<div class="popupScroller">
        	<div class="popContentWrapper">
            	<div class="allHolder">
                	<div id="popupItems" class="popupItems" style="display:block;">
					<h2>JavaScript is disabled on your browser</h2>
					Please enable JavaScript or upgrade to a JavaScript-capable browser to use Authentic Avenue.
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="popupBottom">&nbsp;</div>
</div>
</noscript>

</head>
<body>
<div id="overlay_div"></div>
<div class="popupWrapper">
	<a href="javascript:void(0);" class="popupClose">&nbsp;</a>
	<div class="popupTop">&nbsp;</div>
          <div class="popupContent">
              <div id="loader">loading...</div>
    	<div class="popupScroller">
        	<div class="popContentWrapper">
            	<div class="allHolder">
                	<div id="popupItems" class="popupItems"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="popupBottom">&nbsp;</div>
</div>
<div id="wrapper">
<div class="header">
<?php echo $this->element('home/header'); ?>
</div>
 <div class="main-container">
 <div class="globalbreadcrumb">
 <p>You are here:&nbsp;<?php echo $this->Html->getCrumbs(' >> ','Home');?>
</p>
 </div>
<!--End Banner-->
<div class="innercon">    
<div class="lftnav">
<?php if($session->read('Auth.User.id')!=null){
if($this->params['action']=='search_result' OR $this->params['action']=='advance_search' OR $this->params['action']=='browsebycategory' OR $this->params['action']=='browsebybrand' OR $this->params['action']=='browsebycompletedlist' OR $this->params['action']=='browsebyprice' OR $this->params['action']=='browsebysize' OR $this->params['action']=='browsebycolor'){
echo $this->element('home/leftmenu');

}  else {
    echo $this->element('home/leftmenuproduct');
}
}else{
echo $this->element('home/leftmenu');
}
?>
</div>
<!--End Left Navigation-->
<div class="rht-con">
     <?php
    echo $this->Session->flash();
    if ($this->Session->check('Message.auth'))
        echo $this->Session->flash('auth');
    ?>
<?php echo $content_for_layout; ?>
</div>
<!--End Product-->
</div>
</div>
<!--End Content-->
<div class="footer">
   <a title="About Authentic Avenue" href="<?php echo Configure::read('base_url');?>about_us">About Authentic Avenue</a> |
	<a title="User Agreement" href="<?php echo Configure::read('base_url');?>user_agreements">User Agreement</a> |  
	<a title="Buyers" href="<?php echo Configure::read('base_url');?>about_us/index/15">Buyers</a> |
	<a title="Sellers" href="<?php echo Configure::read('base_url');?>about_us/index/7">Sellers</a> |
	<a href="<?php echo Configure::read('base_url');?>about_us/faqs/">Ask a Question</a>
    <p>Copyright &copy; <?php echo date("Y");?> AuthenticAvenue.com All Right Reserved</p>
<!--End Footer-->
</div>
</div>
<?php echo $this->element('sql_dump'); ?>

</body>
</html>